from django.contrib import admin
from library import models
# Register your models here.

class AuthorAdmin(admin.ModelAdmin):
    list_display = ['authorid','authorname','authorage','authorcity','authortelno','authoremail','authorworkaddress']
    # 实现分页,每页十个数据
    list_per_page = 10
    # Action的位置
    actions_on_top = True
    actions_on_bottom = True
    # 筛选器添加
    list_filter = ['authorage']
    # 查询
    search_fields = ['authorid','authorname']

admin.site.register(models.Author,AuthorAdmin)
admin.site.register(models.Book)
admin.site.register(models.Booktype)
admin.site.register(models.Press)
admin.site.register(models.Student)
admin.site.register(models.Borrowbook)

